<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>align-items</title>
    <style>
      .flex-container {
        display: -webkit-flex;
        display: flex;
        width: auto;
        height: 300px;
        background-color: lightgrey;
      }

      .flex-item {
        background-color: cornflowerblue;
        width: 100px;
        height: 100px;
        line-height: 100px;
        margin: 10px;
        text-align: center;
      }
    </style>
  </head>

  <body>
    <h1>align-items 设置或检索弹性盒子元素在侧轴（纵轴）方向上的对齐方式。</h1>

    <h2>
      align-items: flex-start
      弹性盒子元素的侧轴（纵轴）起始位置的边界紧靠住该行的侧轴起始边界。
    </h2>
    <div class="flex-container" style="align-items: flex-start">
      <div class="flex-item">flex item 1</div>
      <div class="flex-item">flex item 2</div>
      <div class="flex-item">flex item 3</div>
    </div>

    <h2>
      align-items: flex-end
      弹性盒子元素的侧轴（纵轴）起始位置的边界紧靠住该行的侧轴结束边界。
    </h2>
    <div class="flex-container" style="align-items: flex-end">
      <div class="flex-item">flex item 1</div>
      <div class="flex-item">flex item 2</div>
      <div class="flex-item">flex item 3</div>
    </div>

    <h2>
      align-items: center
      弹性盒子元素在该行的侧轴（纵轴）上居中放置。（如果该行的尺寸小于弹性盒子元素的尺寸，则会向两个方向溢出相同的长度）。
    </h2>
    <div class="flex-container" style="align-items: center">
      <div class="flex-item">flex item 1</div>
      <div class="flex-item">flex item 2</div>
      <div class="flex-item">flex item 3</div>
    </div>

    <h2>
      align-items: baseline
      如弹性盒子元素的行内轴与侧轴为同一条，则该值与'flex-start'等效。其它情况下，该值将参与基线对齐。
    </h2>
    <div class="flex-container" style="align-items: baseline">
      <div class="flex-item">flex item 1</div>
      <div class="flex-item">flex item 2</div>
      <div class="flex-item">flex item 3</div>
    </div>

    <h2>
      align-items: stretch
      如果指定侧轴大小的属性值为'auto'，则其值会使项目的边距盒的尺寸尽可能接近所在行的尺寸，但同时会遵照'min/max-width/height'属性的限制。
    </h2>
    <div class="flex-container" style="align-items: stretch">
      <div class="flex-item" style="height: auto">flex item 1</div>
      <div class="flex-item" style="height: auto">flex item 2</div>
      <div class="flex-item" style="height: auto">flex item 3</div>
    </div>
  </body>
</html>
